/***************************************************************************
File:        lineeditvalue.h
Description: Line edit linked to a variable

Copyright:   (C) 2000 by ZJ Laczik
Email:       Z.J.Laczik@oxford-optics.ac.uk
****************************************************************************
Change log:
  begin      Sun Apr 30 2000
   15/2/2012	QT4 update
***************************************************************************/

#ifndef __EDITVALUE_H__
#define __EDITVALUE_H__

#include <QLineEdit>

class LineEditValue : public QLineEdit
{
    Q_OBJECT
private:
    int mDirty;
    bool mChangedFlag;
public:
    LineEditValue( QWidget * parent);
    ~LineEditValue();
    bool getChangedFlag();
    void setChangedFlag();
    void clearChangedFlag();

public slots:
    void Update(const char *);
    void Update(const QString &);
    void Update(unsigned char);
    void Update(int);
    void Update(long int);
    void Update(float);
    void Update(double);

signals:
    void ValueChanged(const char*);
    void ValueChanged(const QString &);
    void ValueChanged(unsigned char);
    void ValueChanged(int);
    void ValueChanged(long int);
    void ValueChanged(float);
    void ValueChanged(double);

protected:

private:
    void clearDirtyFlag();
    void ValueChanged();

private slots:
    void setDirtyFlag();
    void keyPressEvent( QKeyEvent * );
    void focusOutEvent ( QFocusEvent * );
};

#endif
